﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Spotless.Data;
using System.Web.Mvc;

namespace SpotlessWeb.Models
{
    public abstract class BaseDrillDownViewModel
    {
        public Category[] Categories { get; set; }
        public IEnumerable<SelectListItem> CategoriesAsSelectList()
        {
            return Categories.Select(x => new SelectListItem() { Text = x.Name, Value = x.CategoryId.ToString() });
        }
        public DrillDown[] DrillDowns { get; set; }
        public IEnumerable<SelectListItem> DrillDownsAsSelectList()
        {
            return DrillDowns.Select(x => new SelectListItem() { Text = x.Name, Value = x.DrillDownId.ToString() });
        }
        public bool AllowEdit { get; set; }
        public IEnumerable<SelectListItem> Manufactures { get; set; }
    }

    /*public class DrillDownViewModel
    {
        public List<DrillDown> Parents { get; set; }
        public List<DrillDown> Chidren { get; set; }

        public List<SelectListItem> ChildrenAsSelectList
        {
            get
            {
                return Chidren.Select(x => new SelectListItem() {Text = x.Name, Value = x.DrillDownId.ToString() }).ToList();
            }
        }
    }*/
}
